<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Chaining</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="../js/underscore.js"></script>
    <script>
        var array = [1, 4, 9, 16, 25, 36, 49];
        // 转换为链式调用
        var result = _.chain(array)
            .map(Math.sqrt)
            .filter(x => x % 2 == 1);
        console.log(JSON.stringify(result));
    </script>
</head>

<body>

</body>

</html>